package com.eudon.design_pattern.structural.composite;

/**
 * @author eudon
 * @description 使用示例
 * @date 2025/9/2
 * @email syd19970616@gmail.com
 * @address <a href="https://gitee.com/eudon">Gitee</a>
 */
public class Use {
    public static void main(String[] args) {
        Directory root = new Directory("files");
        Directory eudon = new Directory("files/eudon");
        Directory ivy = new Directory("files/ivy");

        File file_a = new File("files/eudon/a.txt");
        File file_b = new File("files/ivy/b.txt");
        File file_c = new File("files/ivy/c.txt");

        eudon.add(file_a);
        ivy.add(file_b);
        ivy.add(file_c);
        root.add(eudon);
        root.add(ivy);

        System.out.println(root.count());
    }
}
